package com.zoe.flowable;

import cn.hutool.extra.spring.SpringUtil;
import lombok.Getter;
import org.flowable.engine.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * flowable 引擎注入封装
 * @author XuanXuan
 * @date 2021-04-03
 */
@Component
@Getter
public class FlowServiceFactory {

    @Resource
    RepositoryService repositoryService;

    @Resource
    RuntimeService runtimeService;

    @Resource
    IdentityService identityService;

    @Resource
    TaskService taskService;

    @Resource
    HistoryService historyService;

    @Resource
    ManagementService managementService;

    @Qualifier("processEngine")
    @Resource
    ProcessEngine processEngine;

    public static FlowServiceFactory of() {
        return SpringUtil.getBean(FlowServiceFactory.class);
    }


}
